<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/script/fullcalendar-3.0.1/lib/jquery.min.js"></script>
<link rel="stylesheet" type="text/css"
	href="${ pageContext.request.contextPath }/resources/script/jquery.datetimepicker.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/script/jquery.datetimepicker.full.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/script/layer/layer.js"></script>
<style type="text/css">
.select {
	width: 60px;
	height: 25px;
	padding: 4px;
	appearance: none;
	-moz-appearance: none;
	-webkit-appearance: none;
	border: solid 1px gray;
	/*在选择框的最右侧中间显示小箭头图片*/
	background: url("http://ourjs.github.io/static/2015/arrow.png")
		no-repeat scroll right center transparent;
	/*为下拉小箭头留出一点位置，避免被文字覆盖*/
	padding-right: 14px;
}

button, input {
	border: 1px solid #999;
	padding: 5px 5px;
	min-width: 60px;
	/* margin: 0 10px 10px 0; */
}

button {
	cursor: pointer;
}

.error {
	color: #ff0000;
	font-style: italic;
	font-weight: bold;
	font-size: 14px;
	font-family: 幼圆;
}
</style>
<script type="text/javascript">
	$(document).ready(function() {
		var index = parent.layer.getFrameIndex(window.name);
		$.datetimepicker.setLocale('ch');
		$('#datetimepicker1,#datetimepicker2').datetimepicker({
			step : 30,
			timepicker : false,
			format : "Y-m-d",
		});
		$('#closeIframe').click(
		function() {
			parent.layer.close(index);
		});
	});
</script>
</head>
<body>
	<div style="margin-left: 40px; line-height: 200%;">
		<sf:form commandName="leaveForm"
			action="${ pageContext.request.contextPath }/usermanager/saveleave" method="post">
		请假类型：<sf:select path="type"
				items="${[ '年假', '调休假', '病假', '婚假', '公假', '产假', '事假', '陪产假', '产前假', '探亲假', '哺乳假' ] }"
				cssClass="select" />
			<br>
		请假范围：<sf:input path="fromTime" id="datetimepicker1" type="text"
				style="vertical-align: middle; width: 110px" value='' />
			<span>到</span>
			<sf:input id="datetimepicker2" path="toTime" type="text"
				style="vertical-align: middle; width: 110px" value='' />
			<c:choose>
				<c:when test="${errors.fromTime != null}">
					<sf:errors cssClass="error" path="fromTime" />
				</c:when>
				<c:otherwise>
					<sf:errors cssClass="error" path="toTime" />
				</c:otherwise>
			</c:choose>

			<br>
		请假原因：<sf:errors path="reason" cssClass="error"></sf:errors>
			<br>
			<sf:textarea path="reason" rows="10"
				style="resize: none; width: 360px; margin-left: 20px; padding: 4px;font-size: 14px;"
				cols="" />
			<br>
			<div align="center">
				<input type="submit" value="确定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input id="closeIframe" type="button" value="取消">
			</div>
		</sf:form>
	</div>
</body>
</html>